/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: dings
 * Date: 2024-06-03
 * Time: 20:56
 */
public class Demo {
    @Override
    public boolean contains(int toFind) {
        for (int i = 0; i < usedSize; i++) {
            if(arr[i] == toFind) {
                return true;
            }
        }
        return false;
    }
    /**
     * 包含 toFind 返回 下标
     * 否则 返回 -1
     * @param toFind
     * @return
     */
    @Override
    public int indexOf(int toFind) {
        for (int i = 0; i < useSize; i++) {
            if(toFind == arr[i]) {
                return i;
            }
        }
        return -1;
    }
}
